﻿@using BonjourQuotation.UI.Models.PartialModel
@model QuotationCostPriceGridViewModel

@using (Ajax.BeginForm("CalculateQuotaCostPriceGrid", "Quotation", new AjaxOptions() { HttpMethod = "Post", UpdateTargetId = "tabCost", InsertionMode = InsertionMode.Replace }, new { enctype = "multipart/form-data", id = "QuotaCostPriceGridForm" }))
{
    @Html.HiddenFor(model => model.CostPriceFreeCalc)
    @Html.HiddenFor(model => model.CostPriceQuotaID)
   <table class="table table-bordered table-hover">
    <th>#</th>
    <th>Pax</th>
    <th>Htl</th>
    <th>Meals</th>
    <th>Ent</th>
    <th>Msc</th>
    <th>Entr</th>
    <th>Misc</th>
    <th>Bus</th>
    <th>Guide</th>
    <th>Cost</th>
    <th>Free</th>
    <th>=</th>
    <th>Given</th>
    <th>Price</th>
    <th>Adjs</th>
    <th>F. Price</th>
    <th>Pax</th>
    <th>X</th>
    <th>M</th>
    <th>Curr</th>
    @*<th>delete</th>*@
    <tbody>
        @for (int ind = 0; ind < Model.Rows.Count; ind++)
{
    <tr class="@(@Model.Rows[ind].CurrencyCostPrice == "CA" ? "trCurrencyCad" : "")">
        <td>
            @Html.LabelForModel(Model.Rows[ind].LineNo, new { @class = "Label_CostPr" })
            @Html.HiddenFor(model => model.Rows[ind].LineNo)
        </td>
        <td >
            @Html.LabelForModel(Model.Rows[ind].Pax, new { @class = "table_inputs_40 Label_CostPr" })
        </td>
        <td >
            @Html.LabelForModel(Model.Rows[ind].HtlPP, new { @class = "table_inputs_Decimal Label_CostPr" })
        </td>
        <td>@Html.LabelForModel(Model.Rows[ind].LDnPP, new { @class = "table_inputs_Decimal Label_CostPr" })</td>
        <td>@Html.LabelForModel(Model.Rows[ind].EntPP, new { @class = "table_inputs_Decimal Label_CostPr" })</td>
        <td>@Html.LabelForModel(Model.Rows[ind].MscPP, new { @class = "table_inputs_Decimal Label_CostPr" })</td>
        <td>@Html.LabelForModel(Model.Rows[ind].EnGPP, new { @class = "table_inputs_Decimal Label_CostPr" })</td>
        <td>@Html.LabelForModel(Model.Rows[ind].MscGPP, new { @class = "table_inputs_Decimal Label_CostPr" })</td>
        <td>@Html.LabelForModel(Model.Rows[ind].BusPP, new { @class = "table_inputs_Decimal Label_CostPr" })</td>
        <td>@Html.LabelForModel(Model.Rows[ind].GuiPP, new { @class = "table_inputs_Decimal Label_CostPr" })</td>
        <td>@Html.LabelForModel(Model.Rows[ind].TotalCost, new { @class = "table_inputs_60 Label_CostPr" })</td>
        <td>@Html.LabelForModel(Model.Rows[ind].TotalFree, new { @class = "table_inputs Label_CostPr" })</td>
        <td>@Html.LabelForModel(Model.Rows[ind].Sold, new { @class = "table_inputs_60 Label_CostPr" })</td>
        <td>@Html.LabelForModel(Model.Rows[ind].GivenFree, new { @class = "table_inputs Label_CostPr" })</td>
        <td>@Html.LabelForModel(Model.Rows[ind].GivenSold, new { @class = "table_inputs Label_CostPr ColorRed" })</td>
        <td>@Html.TextBoxFor(model => Model.Rows[ind].FAdjust, new { @class = "table_inputs_40 ColorBlue CostPriceDetTab QuotaMoneyTxb QuotaOnlyDecimalDigitsNeg table_inputs_WithoutBox" })</td>
        <td>@Html.LabelForModel(Model.Rows[ind].FinalPrice, new { @class = "table_inputs_60 ColorRed", @style = "font-weight:700" })</td>
        <td>@Html.LabelForModel(Model.Rows[ind].PaxL, new { @class = "table_inputs_40 Label_CostPr" })</td>
        <td>@Html.LabelForModel(Model.Rows[ind].Profit, new { @class = "table_inputs Label_CostPr" })</td>
        <td>@Html.CheckBoxFor(model => Model.Rows[ind].MM, new { @class = "table_inputs_checkbox" })</td>
        @if(Model.Rows[ind].CurrencyCostPrice == "CA")
        { 
            <td>@Html.LabelForModel(Model.Rows[ind].CurrencyCostPrice, new { @class = "table_inputs_40 Label_CostPr QuotationCurrCAD" })</td>
        }
        else
        {
            <td>@Html.LabelForModel(Model.Rows[ind].CurrencyCostPrice, new { @class = "table_inputs_40 Label_CostPr" })</td>
        }
        @*<td><button class="btn btn-danger" style="padding:0px;" onclick="RemoveCostPrice('@GridItm.LineNo')">Delete</button></td>*@

    </tr>
}
    </tbody>
</table>
<div class="row form-row">
    <div class=" col-lg-1 pull-right" style="margin-right:5px;">
        <div class="input-group">
            @if (Model.QuotaCostPriceCalculateCostBtnView && !(Model.QuotaCostPriceConfirmed))
            {
                <input type="button" id="CalculateCostBtn" class="pull-right" value="Calculate">
            }
        </div>
    </div>
    
    @if (Model.Rows.Any(row => row.CurrencyCostPrice == "CA"))
    {
       
        <div class=" col-lg-2 withoutPadding pull-left" style="width: 12% !important; margin-left:30px;">
            <div class="input-group">
                <span class="input-group-addon SumControlsLabelFSize" style="width: 30px !important;">@Html.LabelFor(model => model.SSAdjsCad)</span>
                @Html.TextBoxFor(model => model.SSAdjsCad, new { @class = "ColorBlue form-control SumControlsFSize CostPriceDetTab QuotaMoneyTxb QuotaOnlyDecimalDigitsNeg" })
            </div>
        </div>
         if (Model.SSSumFinalCad != null)
        {
            <div class=" col-lg-2 withoutPadding pull-left" style="width: 18% !important;">
                <div class="input-group">
                    <span class="input-group-addon SumControlsLabelFSize" style="width: 30px !important;">@Html.LabelFor(model => model.SSSumFinalCad)</span>
                    @Html.LabelForModel(Model.SSSumFinalCad, new { @class = "form-control SumControlsFSize ColorRedBold" })
                </div>
            </div>
        }
    }
    <div class=" col-lg-2 withoutPadding pull-right" style="width: 13% !important;">
        <div class="input-group">
            <span class="input-group-addon SumControlsLabelFSize" style="width: 30px !important;">@Html.LabelFor(model => model.SSSumFinal)</span>
            @Html.LabelForModel(Model.SSSumFinal, new { @class = "form-control SumControlsFSize ColorRedBold" })
        </div>
    </div>
    <div class=" col-lg-2 withoutPadding pull-right" style="width: 9% !important; ">
        <div class="input-group">
            <span class="input-group-addon SumControlsLabelFSize" style="width: 30px !important;">@Html.LabelFor(model => model.SSAdjs)</span>
            @Html.TextBoxFor(model => model.SSAdjs, new { @class = "ColorBlue form-control SumControlsFSize CostPriceDetTab QuotaMoneyTxb QuotaOnlyDecimalDigitsNeg" })
        </div>
    </div>
    
    
    @*<div class=" col-lg-2 withoutPadding pull-right" style="width: 17% !important;">
        <div class="input-group">
            <span class="input-group-addon SumControlsLabelFSize" style="width: 30px !important;">@Html.LabelFor(model => model.SSSum)</span>
            @Html.LabelForModel(Model.SSSum, new { @class = "form-control SumControlsFSize ColorRedBold" })
        </div>
    </div>*@ 
   
</div>
}
@*<button class="btm btn-success">Update</button>*@


        
  


